import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/HomeUser'
            // redirect: '/merchant'

        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                // {
                //     path: '/dashboard',
                //     component: () => import('../components/page/Dashboard.vue'),
                //     meta: { title: '系统首页' }
                // },
                {
                    path: '/HomeUser',
                    component: () => import('../pages/HomeUser/index.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/UserAuthorization',
                    component: () => import('../pages/UserAuthorization/index.vue'),
                    meta: { title: '授权码管理' }
                },
                {
                    path: '/Publish',
                    component: () => import('../pages/Publish/index.vue'),
                    meta: { title: '发布单管理' }
                },
                {
                    path: '/SystemPeople',
                    component: () => import('../pages/SystemPeople/index.vue'),
                    meta: { title: '后台人员管理' }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                }
               
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        },
        {
            path: '/401',
            component: () => import(/* webpackChunkName: "403" */ '../components/page/401.vue'),
            meta: { title: '401' }
        },
    ]
});
